PyPI: Only use major version for libnvme.so#3060
Conversation
When building a pip (PyPI) package, do not set the libnvme.so version to major.minor.patch (e.g. libnvme.so.3.0.0), but instead just set it to the major (e.g. libnvme.so.3). pip/wheel do not care about the full versioning, and since symbolic links cannot be installed via pip (i.e. libnvme.so.3 -> libnvme.so.3.0.0), it's better to just skip the major.minor.patch versioning for PyPI. To support this we're introducing a new config flag "pypi" to let meson know we're building for pip/PyPI. Signed-off-by: Martin Belanger <[email protected]>
When we "pip install" a PyPI package previously built with "pipx run build --sdist", there is a missing symbolic link in the directory where libnvme.so.X.Y.Z is installed. For example, let's say we build libnvme.so.3.0.0. There needs to be a symbolic link installed along with the library as follows: libnvme.so.3 -> libnvme.so.3.0.0 Signed-off-by: Martin Belanger <[email protected]>
|
Just as idea: doesn't PyPi set a build environment variable? Couldn't we use that one as input? Or is this a stupid idea? |
|
I'm not familiar with the PyPI build environment variables. Heck, I did not know anything about building PyPI until a few days ago... 😄. But I'm curious to know what you have in mind. Yes, it does make sense to toggle all the options based on the |
|
@igaw - Note that toggling the other options based on For example, we can overwrite options like this: We just need to make sure to use Would you like me to proceed with this change? |
|
Okay, sounds like asking for trouble. Let's go with your solution. If it works we can still clean it up if needed. |
When building a pip (PyPI) package, do not set the libnvme.so version to major.minor.patch (e.g. libnvme.so.3.0.0), but instead just set it to the major (e.g. libnvme.so.3). pip/wheel do not care about the full versioning, and since symbolic links cannot be installed via pip (i.e. libnvme.so.3 -> libnvme.so.3.0.0), it's better to just skip the major.minor.patch versioning for PyPI.
To support this we're introducing a new config flag "pypi" to let meson know we're building for pip/PyPI.
@igaw - After doing more testing I found that the previous fix to set the symbolic links did not work. This PR reverts the previous change and provides a simpler fix more in line with PyPI packages.